﻿function ClientUpdateFunction()
{
    retValue=Portal.SystemWebParts.Function.Function.ServerSideAutoUpdate().value;
    if(retValue.indexOf("ERROR")!=-1)
    {
        alert(retValue);
        return;
    }
    alert(retValue);
}

function RunFilter()
{
    document.getElementById("divProcessing").innerHTML=Portal.SystemWebParts.Function.Function.GetProcessingText().value;
    setTimeout("RealRunFilter()",10);
}

function RealRunFilter()
{
    PageIndex=0;
    if(document.getElementById("divSelectPage")!=null)
    {
        PageIndex=document.getElementById("divSelectPage").selectedIndex;
    }
    value=Portal.SystemWebParts.Function.Function.GetFunction(PageIndex).value;
    if(value.indexOf("ERROR")!=-1)
    {
        alert(value);
        return;
    }
    document.getElementById("divProcessing").innerHTML="";
    document.getElementById("divFunctionContent").innerHTML=value;
}


function DeleteFunction(WebPartId,FunctionCode)
{
    ConfirmMsg=Portal.SystemWebParts.Function.Function.GetConfirmDeleteMsg().value;
    if(confirm(ConfirmMsg)==false)return;
    retValue=Portal.SystemWebParts.Function.Function.ServerSideDeleteFunction(WebPartId,FunctionCode).value;
    alert(retValue);
    if(retValue.indexOf("ERROR")!=-1)
    {
        RunFilter();
    }
}